/**
 * Permute By Sorting: randomized the input array
 * @param A the array
 * @returns a randomized sorted array
 */
export function PermuteBySorting(A: number[]): number[] {
	const n = A.length;
	const p = new Array<number>(n)
	for (let i = 0; i < n; i += 1) {
		p[i] = Math.random() * n ** 3
	}
	// sort A, using P as sort keys
	return A
}
